<html>
<head><meta charset="utf-8"><title>Where can we post newbie doubts? · new members · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/index.html">new members</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html">Where can we post newbie doubts?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="227724541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227724541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227724541">(Feb 25 2021 at 06:37)</a>:</h4>
<p>Hello everybody,<br>
 I am Surya. I have been using Golang for couple of years now. Getting started in rustlang.<br>
 I came to know that this zulip community is equivalent to the the Gopher's slack channel.<br>
 I do have couple of basic newbie doubts that can be easily addressed through dicussion than by google search. Do we have any stream for newbie doubts of sorts?</p>
<p>From what I understand <code>match</code> seems to be a syntatic sugar for <code>if else</code> blocks.<br>
I tried to write an if block equivalent for a <code>match</code> <a href="https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=7f1c5e214d0f80c0f298e7e7ab789840">https://play.rust-lang.org/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=7f1c5e214d0f80c0f298e7e7ab789840</a><br>
and I am getting an error.</p>
<p>If it works with match, why isn't my code working with if block.</p>
<p>Thanks again.</p>



<a name="227725416"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227725416" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227725416">(Feb 25 2021 at 06:49)</a>:</h4>
<p>If you'd like something more like Slack, you might like the community discord over at <a href="https://bit.ly/rust-community">https://bit.ly/rust-community</a></p>



<a name="227730536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227730536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227730536">(Feb 25 2021 at 07:55)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="125270">@scottmcm</span></p>



<a name="227733024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227733024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227733024">(Feb 25 2021 at 08:21)</a>:</h4>
<p><span class="user-mention" data-user-id="379674">@Surya</span> the syntax you're looking for is <code>if let Ok(v) = result</code></p>



<a name="227767285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767285">(Feb 25 2021 at 13:35)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span>  that works.<br>
The syntax seems unusual to me. ( I have worked in ruby and golang before)<br>
result.Ok  would have been more intuitive to me.</p>



<a name="227767430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Olivier FAURE <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767430">(Feb 25 2021 at 13:36)</a>:</h4>
<p>For that kind of question I think the standard channel is <a href="http://users.rust-lang.org/">users.rust-lang.org/</a></p>



<a name="227767545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767545">(Feb 25 2021 at 13:37)</a>:</h4>
<p><span class="user-mention" data-user-id="263609">@Olivier FAURE</span>  oh can newbies post there too?</p>



<a name="227767748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767748">(Feb 25 2021 at 13:39)</a>:</h4>
<p>Of course they can</p>



<a name="227767755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Olivier FAURE <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767755">(Feb 25 2021 at 13:39)</a>:</h4>
<p>Yup. It's the standard forum for newcomers who have questions about Rust syntax.</p>



<a name="227767789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Olivier FAURE <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767789">(Feb 25 2021 at 13:39)</a>:</h4>
<p>The Zulip (aka here) is more for developers who work on the Rust compiler and tooling</p>



<a name="227767886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227767886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Domenic Quirl <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227767886">(Feb 25 2021 at 13:40)</a>:</h4>
<p>That said: If you look at the definition of <code>Result</code>, e.g. here in the standard library docs (<a href="https://doc.rust-lang.org/std/result/enum.Result.html">https://doc.rust-lang.org/std/result/enum.Result.html</a>), you'll see that it is indeed <code>Result::Ok(v)</code>. However, there is a module called <code>prelude</code> which includes some often-used or generally important items (types, functions, ...) by default, including <code>Result</code> itself, as well as the <code>Ok</code> and <code>Err</code> variants. You can look at what else is in there here: <a href="https://doc.rust-lang.org/std/prelude/index.html">https://doc.rust-lang.org/std/prelude/index.html</a></p>



<a name="227768160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227768160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227768160">(Feb 25 2021 at 13:42)</a>:</h4>
<p>The syntax looks like this because it's a form of pattern matching, just like in <code>match result { Ok(v) =&gt; ... }</code>. It's not an equality comparison</p>



<a name="227768466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227768466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227768466">(Feb 25 2021 at 13:44)</a>:</h4>
<p>Indeed, I think it's a bit of misrepresentation to say that match is sugar for chained if-else. In fact <code>if let</code> is sugar for <code>match</code>, and <code>match</code> is not reducible to more basic operations. (It is desugared internally in the compiler, but the operations it is desugared into have no surface syntax)</p>



<a name="227768588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227768588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227768588">(Feb 25 2021 at 13:45)</a>:</h4>
<p><code>match</code> is the only (safe) way to get at the contents in the variants of an enum</p>



<a name="227768714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227768714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227768714">(Feb 25 2021 at 13:46)</a>:</h4>
<p>Thank you <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span> and <span class="user-mention" data-user-id="271719">@Mario Carneiro</span>  that is helpful, my doubt is clear now.</p>



<a name="227768762"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227768762" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227768762">(Feb 25 2021 at 13:46)</a>:</h4>
<p><span class="user-mention" data-user-id="337115">@Domenic Quirl</span>  Thank you for the resources, will read on it.</p>



<a name="227770865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227770865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227770865">(Feb 25 2021 at 14:02)</a>:</h4>
<p><span class="user-mention" data-user-id="263609">@Olivier FAURE</span>  Thanks for the info. I will keep myself to discord and the other newbie forum. I am just getting started with Rust and I am not sure if I will be working on rust compiler or tooling anytime soon.</p>



<a name="227771271"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227771271" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Olivier FAURE <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227771271">(Feb 25 2021 at 14:04)</a>:</h4>
<p>Yeah, the compiler is tough. Not <em>that</em> tough (I did my first rustc PR with almost no rust experience), but a lot tougher than just learning rust</p>



<a name="227771695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227771695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227771695">(Feb 25 2021 at 14:07)</a>:</h4>
<p>Well, <code>rust-analyzer</code> uses Zulip too, and it has a lower entry bar for contributors (you can build it with <code>cargo build</code> and so on)</p>



<a name="227773406"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227773406" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227773406">(Feb 25 2021 at 14:19)</a>:</h4>
<p>I will contribute someday soon <span aria-label="fingers crossed" class="emoji emoji-1f91e" role="img" title="fingers crossed">:fingers_crossed:</span> :)</p>



<a name="227797515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227797515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227797515">(Feb 25 2021 at 16:42)</a>:</h4>
<p><span class="user-mention" data-user-id="379674">@Surya</span> You are still welcome here as well. It's not that questions are unwelcome here; it's more that there are fewer people to answer them compared to Discord or the users forum.</p>



<a name="227798479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Where%20can%20we%20post%20newbie%20doubts%3F/near/227798479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Surya <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Where.20can.20we.20post.20newbie.20doubts.3F.html#227798479">(Feb 25 2021 at 16:48)</a>:</h4>
<p><span class="user-mention" data-user-id="239881">@Josh Triplett</span>  Thanks a lot Josh. Yeah, I understood the context. Thanks again for the friendly note :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>